import java.awt.*;
import java.util.LinkedList;

public class PlayerObject {
    LinkedList<Player> playerLinked = new LinkedList<Player>();
    public void render(Graphics g) {
        g.setColor(Color.red);
        for(int i = 0; i < playerLinked.size(); i++){
            Player tempObject = playerLinked.get(i);
            tempObject.render(g);
        }
    }

    public void tick() {
        for(int i = 0; i < playerLinked.size(); i++){
            Player tempObject = playerLinked.get(i);
             tempObject.tick();
        }
    }
    public void playerMove(java.awt.event.MouseEvent e,GameStats gameStats,PlayerObject playerObject,EnemyObject enemyObject) {
        for(int i = 0; i < playerLinked.size(); i++){
            Player tempObject = playerLinked.get(i);
            tempObject.playMove(e,gameStats,playerObject,enemyObject);
        }
    }

    public void addPlayer(Player object){
        this.playerLinked.add(object);
    }
    public void removePlayer(Player object){
        this.playerLinked.remove(object);
    }
}

